from models import db, BaseModel


class SchemaField(BaseModel):
    """
    模型字段模型
    """
    __tablename__ = "dev_schema_field"
    __table_args__ = ({"comment": "模型字段"})
    schemaId = db.Column(db.BigInteger, name="schema_id", unique=False, nullable=True, comment="所属模型")
    fieldName = db.Column(db.String, name="field_name", unique=False, nullable=True, comment="字段名称")
    remark = db.Column(db.String, name="remark", unique=False, nullable=True, comment="字段注释")
    fieldSize = db.Column(db.Integer, name="field_size", unique=False, nullable=True, comment="字段长度")
    dataType = db.Column(db.String, name="data_type", unique=False, nullable=True, comment="数据类型")
    isPrimary = db.Column(db.Integer, name="is_primary", unique=False, nullable=True, comment="是否主键")
    nullable = db.Column(db.Integer, name="nullable", unique=False, nullable=True, comment="允许为空")
    defaultValue = db.Column(db.String, name="default_value", unique=False, nullable=True, comment="默认值")
    component = db.Column(db.String, name="component", unique=False, nullable=True, comment="表单组件")
    sort = db.Column(db.BigInteger, name="sort", unique=False, nullable=True, comment="排序")
    variable = db.Column(db.String, name="variable", unique=False, nullable=True, comment="扩展属性JSON")
